package jk.framework.spring.cloud.canary.loadbalancer.api;

import jk.framework.canary.core.po.SimpleVersionInfo;
import jk.framework.canary.core.po.VersionInfo;
import jk.framework.canary.core.repository.VersionInfoRepository;
import jk.framework.spring.cloud.canary.loadbalancer.configure.CurrentApiVersionProperties;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author cuichao
 */
public abstract class AbstractLoadBalanceVersionInfoRepository implements VersionInfoRepository {

    @Autowired
    private CurrentApiVersionProperties properties;


    @Override
    public VersionInfo localCurrentVersion() {
        return new SimpleVersionInfo(properties.getCurrentVersion());
    }
}
